package chain.example.delivery.chain;


import chain.example.delivery.DeliveryState;
import chain.example.delivery.decorate.NoneInfo;
import chain.example.delivery.decorate.ShopDeliveryInfo;
import chain.example.delivery.decorate.StateInfo;

public class ShopDeliveryChain implements Delivery {


    @Override
    public StateInfo doDelivery(int state, DeliveryChain wrapperChain) {
        if (state == DeliveryState.SHOP.getState()) {
            return new ShopDeliveryInfo(new NoneInfo());
        }
        return  new ShopDeliveryInfo(wrapperChain.doChain(state));
    }

}
